﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MonopolyRandy
{
    public class SpelerEqualityComparer : IEqualityComparer<Speler>
    {
        public bool Equals(Speler x, Speler y)
        {
            if (object.ReferenceEquals(x, y)) return true;

            if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) return false;

            return x.GetNaam() == y.GetNaam();
        }

        public int GetHashCode(Speler obj)
        {
            if (object.ReferenceEquals(obj, null)) return 0;

            var hashCodeKleur = obj.GetNaam() == null ? 0 : obj.GetNaam().GetHashCode();

            return hashCodeKleur;
        }
    }
}
